import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import { ElMessage } from "element-plus";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import store from "./store";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import { formatDate } from "@/mixin/formartDate";
import axios from "./utils/request";
import VXETable from "vxe-table";
import "vxe-table/lib/style.css";
const app = createApp(App);
//挂载全局
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.use(ElementPlus, {
  locale: zhCn,
});
app.mixin(formatDate);
app.use(VXETable);
app.use(store);
app.use(router);
app.use(ElementPlus);

//vue2常见的写法
// 利用原型
//import axios from './utils/request';
//Vue.prototype.$http axios
//任意的组件组件就可以通过
// this.$http.post("/login",{params:{}})
// this.$http.get("/list")

//事件总线写法
// Vue.prototype.$bus= XX

//Vue3 写法
//利用proxy
app.config.globalProperties.msg = "大佬太强了";
app.config.globalProperties.$http = axios;
app.config.globalProperties.$ElMessage = ElMessage;

app.mount("#app");
